import { ApiRes } from "../types/ApiRes";
import { UserInfo, UserLogin } from "../types/user";
import request from "../utils/request";

export const login = (data : UserLogin) => {
	return request<ApiRes<{ token : string }>>({
		url: 'user/login',
		method: 'POST',
		data
	})
}

export const getUserInfo = () => {
	return request<ApiRes<UserInfo>>({
		url: 'user/info'
	})
}